﻿@using DIS.Infrastructure.Entities.Entity;
@using DIS.Infrastructure.Entities.Enum;
@{
    ViewBag.Title = "用户列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
    string userKey = ViewBag.SearchKey;
    ItemListBox<User> userList = ViewBag.UserList;
}
<table width="98%" border="0" align="center"  cellpadding="3" cellspacing="1"  bgcolor="#D6D6D6">
    <tr>
        <td height="19" colspan="7"  background="/content/img/tbg.gif" bgcolor="#E7E7E7">
            <table width="96%" border="0" cellspacing="1" cellpadding="1">
                <tr>
                    <td style="padding-left: 10px;">
                        <b><strong>用户列表</strong></b>
                    </td>
                    <td align="right">
                        <b><strong><a href="/account/userdetail">添加用户</a></strong></b>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr bgcolor="#FBFCE2">
        <td width="13%" height="24" align="center">
            用户名
        </td>
        <td width="22%" align="center">
            真实姓名
        </td>
        <td width="10%" align="center">
            职位
        </td>
        <td width="12%" align="center">
            QQ
        </td>
        <td width="12%" align="center">
            电话
        </td>
         <td width="12%" align="center">
            状态
        </td>
        <td width="12%" align="center">
            管理项
        </td>
    </tr>
    @{
        if(userList!=null&&userList.Data!=null&&userList.Data.Count>0)
        {
            string stateStr="正常";
            foreach(var item in userList.Data)
            {
                if(!item.IsActivate)
                {
                    stateStr="禁用";
                }
                
                <tr bgcolor="#FFFFFF" align="center" class="hover">
                <td align="center">@item.UserName</td>
                <td align="center">@item.RealName</td>
                <td align="center">@item.SystemRole.Mapping()</td>
                <td align="center">@item.QQ</td>
                <td align="center">@item.Phone</td>
                <td align="center" style="color:Red">@stateStr</td>
                <td align="center"><a href="/account/userdetail?Id=@item.Id" ><u>编辑</u></a> |  <a href="/account/DelUser?Id=@item.Id&page=@userList.CurrentPage&userKey=@userKey" ><u>删除</u></a> </td>
                </tr>
            }
        }
    }
    <tr><td colspan="7" align="right">@Html.Raw(userList.PageItemSegment)</td></tr>
</table>
